<?php


namespace App\Http\Requests\Warehouse\Location;


use Illuminate\Foundation\Http\FormRequest;

class StoreRequest extends FormRequest
{
    /**
     * 规则
     * @return array
     */
    public function rules(): array
    {
        return [
            'column' => ['required', 'integer'],
            'row' => ['required', 'integer'],
            'layer' => ['required', 'integer'],
            'attribute' => ['required', 'integer'],
            'partition' => ['required', 'string', 'alpha', 'max:3'],
            'status' => ['required', 'integer'],
        ];
    }


    public function messages()
    {
        return [
            'column.required' => '货架列数格式不正确',
            'column.integer' => '货架列数格式不正确',
            'row.required' => '货架行数格式不正确',
            'row.integer' => '货架行数格式不正确',
            'layer.required' => '货架层数格式不正确',
            'layer.integer' => '货架层数格式不正确',
            'attribute.required' => '货架属性格式不正确',
            'attribute.integer' => '货架属性格式不正确',
            'status.required' => '货架状态格式不正确',
            'status.integer' => '货架状态格式不正确',
            'partition.required' => '货架区域格式不正确',
            'partition.string' => '货架区域格式不正确',
            'partition.alpha' => '货架区域格式不正确',
            'partition.max' => '货架区域格式不正确',
        ];
    }
}